@model ZKEACMS.FormGenerator.Models.FormField
@{
    string maxLength = "50";
    Model.Attributes["class"] = Model.Attributes["class"] + "Date";
    Model.Attributes.TryAdd("data-val-length", L("The max length of {0} is {1}").Text.FormatWith(Model.DisplayName, maxLength));
    Model.Attributes.TryAdd("data-val-length-max", maxLength);
    Model.Attributes.TryAdd("JsDateFormat", "YYYY/MM/DD");
}
<div class="form-group size-@Model.Size">
    @if (Model.DisplayName.IsNotNullAndWhiteSpace())
    {
        <label class="control-label" for="@Model.ID">
            @Model.DisplayName
            @if (Model.IsRequired)
            {
                <span class="required">*</span>
            }
        </label>
    }
    @if (Model.Description.IsNotNullAndWhiteSpace())
    {
        <span class="text-muted">
            <span>@Model.Description</span>
        </span>
    }
    <div class="input-group">
        @Html.TextBox(Model.ID, Model.Value, Model.Attributes)
        <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
    </div>
    @Html.ValidationMessage(Model.ID)
</div>